import javax.swing.*;
import java.awt.*;

public class GameUI implements GoData {
    GoBangFrame gameJF=new GoBangFrame();
    GameListener gol=new GameListener();

    public void initGameUI(){
        gameJF.setTitle("GoBangUI");
        gameJF.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gameJF.setLayout(null);
        gameJF.setSize(850,800);
        gameJF.setLocationRelativeTo(null);
        gameJF.setVisible(true);
        gameJF.addMouseListener(gol);
        gameJF.chessArr = gol.chessArr;




        String[] strs={"开始游戏","退出"};
        for(int i=0;i<strs.length;i++){
            JButton button=new JButton(strs[i]);
            gameJF.add(button);
            button.setBounds(X+COL*SIZE+50,Y+i*35,100,32);
            button.addActionListener(gol);
        }
        Graphics graphics = gameJF.getGraphics();
        gol.g= graphics;


    }

    public static void main(String[] args) {
        GameUI gameUI = new GameUI();
        gameUI.initGameUI();

        

    }
}






